home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************/
- /* */
- /* CursorAnimation.c */
- /* */
- /* -- cursor animation demo exec for Lightspeed C (V 4.0) */
- /* */
- /* Coded by Eric H. Seale, based on some Lightspeed Pascal */
- /* code by Yasser Farra and Chris Reed (but more about that */
- /* later...). */
- /* */
- /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
- /* */
- /* First, the original "hello" from Yasser Farra's Pascal code: */
- /* */
- /* This demo test shows how to use a beach ball cursor with Lightspeed */
- /* Pascal. This program and the accompanying cursor control unit have */
- /* been modified from a unit I downloaded from a network one day. I */
- /* would like to give credit to Chris Reed of San Angelo, Texas. */
- /* Because he asked not to distribute modified copies of his work, I'm */
- /* uploading this as mine. I needed to use the routines in my */
- /* application, but some modifications were necessary to make them */
- /* commercially sound, especially exception handling. Mr. Reed's */
- /* routines would crash if the "acur" or related resources were not */
- /* in the resource file or could not be loaded. Also, his routines */
- /* used SetUpA5 and RestoreA5 routines which are buggy (tech note 208).*/
- /* Finally, my routines accept the speed of animation as a parameter, */
- /* and can be used with any valid "acur" resource as long as it */
- /* contains the IDs of all related "CURS" resources and those */
- /* resources are in the resource file also. Please use these routines */
- /* as you please and if you'd like some other hints or helpful */
- /* examples drop me a memo. */
- /* */
- /* Yasser Farra */
- /* Box 7351 */
- /* Austin, TX 78713 */
- /* AppleLink: D3002 */
- /* GEnie: Y.FARRA */
- /* */
- /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
- /* */
- /* Now my turn: */
- /* */
- /* I found the included Pascal code sitting all by it's lonesome on */
- /* the nets one day, and I thought to myself -- "Gee, that's neat, but */
- /* what about us poor C hackers? Are we stuck with bland-looking */
- /* applications?" WRONG, bit-breath! And so, a few (+) hours later, */
- /* this nifty set of routines suddenly appeared in a "C" version. */
- /* */
- /* Basically, I just translated Yasser's code into C, and documented */
- /* things 'till I was blue in the face. I also renamed his routines */
- /* (actually, Apple's code -- from Tech Note 208) that replace */
- /* SetupA5 and RestoreA5 -- more on this in the routine code. Oh, */
- /* yes -- I also added some additional acurs and CURS resources (to be */
- /* honest, I snitched them from MacUsers' Hypercard Toolbox stack). */
- /* This demo has the choice of the following acurs: */
- /* */
- /* 0 -- Beachball (in Yasser's stuff) */
- /* 1 -- Paint gun */
- /* 2 -- Running movie */
- /* */
- /* I coded this up using V4.0 of Symantec's THINK C™, so if you use */
- /* another compiler, or an earlier version of THINK C™, just throw out */
- /* the project file, and compile the source. */
- /* */
- /* Feel free to contact me, too, if you'd like. */
- /* */
- /* Eric Seale */
- /* P.O. Box 620352 */
- /* Littleton, CO 80162 */
- /* America Online: MisterBee */
- /* GENIE: E.H.Seale */
- /* */
- /************************************************************************/
-
-
-
- #define beachBall 0
- #define paintGun 1
- #define movieStrip 2
-
-
-
- main()
- {
- InitCursAnimation(movieStrip);
- /* Change the passed parameter for desired effect */
- /* If "acur" resource, or the associated "CURS" resources are not */
- /* found, the standard non-animated watch cursor will be used */
-
- AnimateCursor(6); /* Number of ticks between consecutive frames */
-
- /* Do some processing here */
- while (!Button());
-
- StopCursor();
- }